Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@babel/plugin-transform-shorthand-properties
Advanced tools
Compile ES2015 shorthand properties to ES5
The @babel/plugin-transform-shorthand-properties package is a Babel plugin that transforms object literal shorthand syntax into regular object syntax. This is useful for ensuring compatibility with environments that do not support ES6 shorthand properties.
Transform shorthand properties
Converts shorthand object properties into regular object properties. For example, `{ foo }` becomes `{"foo": foo}`.
{"foo": foo}
Transform shorthand methods
Converts shorthand method definitions into regular function properties. For example, `{ foo() { return 'bar'; } }` becomes `{"foo": function() { return 'bar'; }}`.
{"foo": function() { return 'bar'; }}
This plugin transforms the ES6 spread syntax for arrays and objects, which is somewhat related to shorthand properties in that it's part of the object literal syntax enhancements introduced in ES6. However, it serves a different purpose by allowing an iterable to be expanded in places where zero or more arguments or elements are expected.
This plugin transforms destructuring assignments and rest properties, which are closely related to shorthand properties as they are part of the enhanced object literals in ES6. While @babel/plugin-transform-shorthand-properties focuses on the syntax within object literals, @babel/plugin-transform-destructuring focuses on the syntax used to extract data from arrays or objects.
This plugin adds support for the rest and spread properties for object literals to Babel. It is similar to @babel/plugin-transform-shorthand-properties in that it deals with object literals, but it focuses on the spread and rest properties rather than shorthand syntax.
Compile ES2015 shorthand properties to ES5
See our website @babel/plugin-transform-shorthand-properties for more information.
Using npm:
npm install --save-dev @babel/plugin-transform-shorthand-properties
or using yarn:
yarn add @babel/plugin-transform-shorthand-properties --dev
v7.25.9 (2024-10-22)
babel-parser
, babel-template
, babel-types
syntacticPlaceholders
mode (@liuxingbaoyu)babel-helper-compilation-targets
, babel-preset-env
ClassAccessorProperty
to prevent the no-undef
rule (@victorenator)babel-parser
, babel-types
VISITOR_KEYS
etc. faster to access (@liuxingbaoyu)FAQs
Compile ES2015 shorthand properties to ES5
The npm package @babel/plugin-transform-shorthand-properties receives a total of 13,710,533 weekly downloads. As such, @babel/plugin-transform-shorthand-properties popularity was classified as popular.
We found that @babel/plugin-transform-shorthand-properties demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.